{% extends 'base.html' %}
{% load humanize %}
{% block page-content %}
{% include 'nav_cat_bar.html' %}

<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{{tip}} </h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="#">Config option 1</a>
                            </li>
                            <li><a href="#">Config option 2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                <div>
                    <div class="text-left">
                        {% for user in user_info %}
                        <table class="table">
                            <tr>
                                <td class="text-navy">用户名</td>
                                <td>{{ user.email }}</td>
                            </tr>
                            <tr>
                                <td class="text-navy">姓名</td>
                                <td>{{ user.name }}</td>
                            </tr>
                            <tr>
                                <td class="text-navy">部门</td>
                                <td>{{ user.department }}</td>
                            </tr>
                            <tr>
                                <td class="text-navy">项目</td>
                                <td> {% for pro in user.project.all %} {{pro}}, {% endfor %}<td>
                            <tr>
                                <td class="text-navy">角色</td>
                                <td>
                                    {% ifequal user.is_admin 1 %}
                                    超级管理员
                                    {% else %}
                                    {{user.role}}
                                    {% endifequal %}
                                </td>
                            </tr>
                            <tr>
                                <td class="text-navy">手机</td>
                                <td>{{ user.mobile }}</td>
                            </tr>
                            <tr>
                                <td class="text-navy">座机</td>
                                <td>{{ user.tel }}</td>
                            </tr>
                            <tr>
                                <td class="text-navy">Api Token Info</td>
                                <td>{{ user.token }}</td>
                            </tr>
                            <tr>
                                <td class="text-navy">Email</td>
                                <td>{{ user.email }}</td>
                            </tr>

                            <tr>
                                <td class="text-navy">激活</td>
                                <td>
                                    {% ifequal user.is_active 1 %}
                                        <font color="green">已激活</font>
                                    {% else %}
                                       <font color="red">已禁用</font>
                                    {% endifequal %}
                                </td>
                            </tr>
                            <tr>
                                <td class="text-navy">创建时间</td>
                                <td>{{ user.date_joined|date:"Y-m-d H:i:s" }}</td>
                            </tr>
                            <tr>
                                <td class="text-navy">最后登陆时间</td>
                                <td>{{ user.last_login|date:"Y-m-d H:i:s" }}</td>
                            </tr>
                            <tr>
                            </tr>
                        </table>
                        {% endfor %}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    $(document).ready(function(){
        $('#editable').editableTableWidget({editor: $('<textarea>')});
       });
</script>       








{% endblock %}
